package com.health.mapp.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.health.db.model.DepartmentList;
import com.health.db.service.sm.IDepartmentListService;
import com.health.mapp.bean.Header;
import com.health.mapp.bean.QueryDepartmentListReq;
import com.health.mapp.bean.QueryDepartmentListResp;
import com.health.mapp.utils.Response;
import com.health.mapp.utils.ResultCode;

/**
 * 获取医院科室信息
 * @author yuchong
 */
public class QueryDepartmentListImpl implements ActionInterface{

	@Autowired
	IDepartmentListService departmentListService;
    
    private static Logger logger = Logger.getLogger(QueryDepartmentListImpl.class);

    @Override
    public Response execute(Header header, Object reqBean) throws Exception {


    	QueryDepartmentListReq req = (QueryDepartmentListReq) reqBean;
    	QueryDepartmentListResp _resp = new QueryDepartmentListResp();

		
    	List<DepartmentList> list= departmentListService.selectByAllRecord();
    	
    	
    	_resp.setDepartmentList(list);
		 
		 _resp.setErrorCode(ResultCode.OPERATION_SUCCESS);
		 _resp.setErrorMsg(ResultCode.OPERATION_SUCCESS_NOTE);


        return _resp;
    }

	public IDepartmentListService getDepartmentListService() {
		return departmentListService;
	}

	public void setDepartmentListService(
			IDepartmentListService departmentListService) {
		this.departmentListService = departmentListService;
	}


    
    
    
}
